<%@ include file="/WEB-INF/webCommon/webCommon.jsp"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>作品</title>

<script type="text/javascript">
	//删除
	$(document).ready(function(){
			var id;
			var userId;
			var url;
  			$(".tablelinkdelete").click(function(){
  				id = $(this).attr("id_value");
 			/* carId = $(this).attr("userId"); */
 			url =" <%= basePath%>/sys/ServiceWork_Studelete.action?id="+id;
 			 $(".tip").fadeIn(200);
 			 });
  
 			 $(".tiptop a").click(function(){
 			 $(".tip").fadeOut(200);
			});

  			$(".sure").click(function(){
  			$(".tip").fadeOut(100);
  					window.location.href=url;
			});

				  $(".cancel").click(function(){
				  $(".tip").fadeOut(100);
				}); 
		
	});
</script>
</head>

<body>
	<div class="place">
		<span>位置：</span>
		<ul class="placeul">
			<li><a href="#">首页</a></li>
			<li><a href="#">作品提交</a></li>
		</ul>
	</div>

	<div class="formbody">
		<div id="usual1" class="usual">
			<div id="tab2" class="tabson">

				<form action="<%= basePath%>/sys/ServiceWork_openStuList.action" method="post"  target="rightFrame">
    	<ul class="seachform">
    	 <p:permissions right="queryWork" >
    	    <li><label>综合查询</label></li>
    	    <li><input type="text" name="workName" lay-verify="workName" autocomplete="off" placeholder="作品名称" class="layui-input"></li>
    	 
            <li><button class="layui-btn" lay-filter="chaxu" lay-submit=""/><i class="layui-icon">&#xe615;</i>查询</li>
         </p:permissions>
            <p:permissions right="add" >
           	 	<span><a href="<%= basePath%>/sys/ServiceWork_openStuAdd.action" class="layui-btn" >提交</a></span>
            </p:permissions>
        </ul>
        </form> 
				<table class="layui-table admin-table">
					<thead>
						<tr>

							<th><input name="" type="checkbox" value=""
								checked="checked" /></th>
							<th>序号<i class="sort"><img src="<%=path%>/images/px.gif" /></i></th>

							<th>作品名称</th>
							<th>作品简介</th>
							<th>文件名称</th>
							<th>分组名称</th>
							<th>上传人</th>
							<th>上传时间</th>
							
							<p:permissions menu="deleteWork,editWork">
        <th>操作</th>
        </p:permissions>
        </tr>
        </thead>
        <tbody>
        <s:iterator value="pageResult.data">
        <tr>
        <td><input name="" type="checkbox" value="" /></td>
								<td>${id }</td>

								<td>${workName}</td>
								<td>${workProfile }</td>
								<td>${fileNameMap.get(fileId) }</td>
								<td>${studentGroupNameMap.get(studentGroupId)}</</td>
								<td>${userNameMap.get(userId)}</td>
								<td>${workStartTime}</td>
								
								 <p:permissions menu="deleteWork,editWork">
        
        <td>
        	<p:permissions right="deleteWork">
	     		<a href="javascript:;" class="tablelinkdelete"   id_value="${id}">  
	     		<button class="layui-btn layui-btn-small">
   						 <i class="layui-icon">&#xe640;</i>
 				 </button> </a>&nbsp;&nbsp;
	     	</p:permissions>
	     	<p:permissions right="editWork">
	        	<a href="<%= basePath%>/sys/ServiceWork_openStuEdit.action?workId=${workId}">
	        	<button class="layui-btn layui-btn-small">
                  <i class="layui-icon">&#xe642;</i>
                </button>
                </a>
	        </p:permissions>
	        
	       
        </td>
        </p:permissions>
        
        </tr> 
        </s:iterator>
        </tbody>
				</table>

			</div>

		</div>

		<!-- 分页菜单组件--------------------------开始 -->
		<%
//查询的url地址，统一写
String listActionURL = basePath+"/sys/ServiceWork_openStuList.action";
%>

		<script type="text/javascript">
//分页组件
function change()
  {
  var url = "<%= basePath%>/sys/ServiceWork_openStuList.action";                 //获取表单url
 	var textfield=document.getElementById("textfield").value;
 	var totalPage='${pageResult.totalPage}';
 	var pageNum = 0;
 	if(totalPage*1 >= textfield*1){
 		pageNum = textfield; 
 		 window.location.href  = url+"?page="+pageNum;
 	}else{
 		pageNum = totalPage; 
 		alert("当前只有"+totalPage+"页");
 	}
  	
  }
</script>
		<script type="text/javascript">
			var url = "<%= basePath%>/sys/ServiceWork_openStuList.action"; //获取表单url
			//首页
			function first() {
				window.location.href = url + "?page=1";
			}
			//上一页
			function previous() {
				window.location.href = url + "?page=${pageResult.previousPageNumber}";
			}
			//下一页
			function next() {
				window.location.href = url + "?page=${pageResult.nextPageNumber}";
			}
			//尾页
			function last() {
				window.location.href = url + "?page=${pageResult.totalPage}";
			}
		</script>
		<div class="pagin">
			<div class="message">
				共<i class="blue">${pageResult.total}</i>条记录 <i class="blue">${pageResult.totalPage}</i>页，
				当前显示第&nbsp;<i class="blue">${pageResult.page}</i>页
			</div>
			<ul class="paginList">
				<c:choose>
					<c:when test="${pageResult.isFirst==true}">
						<li class="paginItem current"><a href="javascript:;">首页</a></li>
					</c:when>
					<c:otherwise>
						<li class="paginItem"><a href="javascript:first()"
							target="rightFrame">首页&nbsp;</a></li>
					</c:otherwise>
				</c:choose>
				<c:choose>
					<c:when test="${pageResult.isFirst==true}">
						<li class="paginItem current"><a href="javascript:;">上一页</a></li>
					</c:when>
					<c:otherwise>
						<li class="paginItem"><a href="javascript:previous()"
							target="rightFrame">上一页&nbsp;</a></li>
					</c:otherwise>
				</c:choose>
				<c:choose>
					<c:when test="${pageResult.hasNext==true}">
						<li class="paginItem"><a href="javascript:next()"
							target="rightFrame">下一页&nbsp;</a></li>
					</c:when>
					<c:otherwise>
						<li class="paginItem current"><a href="javascript:;">下一页</a></li>
					</c:otherwise>
				</c:choose>
				<c:choose>
					<c:when test="${pageResult.isLast==true}">
						<li class="paginItem current"><a href="javascript:;">尾页</a></li>
					</c:when>
					<c:otherwise>
						<li class="paginItem"><a href="javascript:last()"
							target="rightFrame">尾页&nbsp;</a></li>
					</c:otherwise>
				</c:choose>
				<li class="paginItem-page">跳转到：&nbsp; <input name="textfield"
					type="text" size="4" class="page-input" id="textfield"
					onchange="change()" />&nbsp;页
				</li>
			</ul>
		</div>
		<!-- 分页菜单组件--------------------------结束 -->
		<script type="text/javascript">
			$("#usual1 ul").idTabs();
		</script>

		<script type="text/javascript">
			$('.tablelist tbody tr:odd').addClass('odd');
		</script>
	</div>

	<div class="tip">
		<div class="tiptop">
			<span>提示信息</span><a></a>
		</div>
		<div class="tipinfo">
			<span><img src="<%=basePath%>images/ticon.png" /></span>
			<div class="tipright">
				<p>是否确认删除信息 ？</p>
				<cite>如果是请点击确定按钮 ，否则请点取消。</cite>
			</div>
		</div>

		<div class="tipbtn">
			<input name="" type="button" class="sure" value="确定" />&nbsp; <input
				name="" type="button" class="cancel" value="取消" />
		</div>

	</div>

</body>
</html>
